import request from '@/utils/request'

// 查询储值列表
export function listBrand(query) {
  return request({
    url: '/prod-api/system/info/list',
    method: 'get',
    params: query
  })
}

export function recordList(query) {
  return request({
    url: '/prod-api/system/info/record/list',
    method: 'get',
    params: query
  })
}


// 修改储值状态
export function updateBrandStatus(rechargeId, dataStatus){
  const data = {
    rechargeId,
    dataStatus
  }
  return request({
    url: '/prod-api/system/info/updateBrandStatus',
    method: 'put',
    data: data
  })
}

// 修改商品推荐状态
export function updateBrandStatusA(rechargeId, isRecommend){
  const data = {
    rechargeId,
    isRecommend
  }
  return request({
    url: '/prod-api/system/info/updateBrandStatus',
    method: 'put',
    data: data
  })
}

// 查询储值详细
export function getBrand(rechargeId) {
  return request({
    url: '/prod-api/system/info/' + rechargeId,
    method: 'get'
  })
}

// 新增储值
export function addBrand(data) {
  return request({
    url: '/prod-api/system/info/add',
    method: 'post',
    data: data
  })
}

// 修改储值
export function updateBrand(data) {
  return request({
    url: '/prod-api/system/info/edit',
    method: 'put',
    data: data
  })
}


// 新增储值权益
export function addRight(data) {
  return request({
    url: '/prod-api/system/rights/add',
    method: 'post',
    data: data
  })
}

// 修改储值权益
export function updateRight(data) {
  return request({
    url: '/prod-api/system/rights/edit',
    method: 'put',
    data: data
  })
}


// 删除储值
export function delBrand(rechargeId) {
  return request({
    url: '/prod-api/system/info/' + rechargeId,
    method: 'delete'
  })
}

// 添加储值
export function addMoneyRecharge(data) {
  return request({
    url: `/prod-api/order/recharge/recharge`,
    method: 'post',
    data: data
  })
}

